home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / quicktime / basics / mfc simpleedit.win / simpleeditmfcdoc.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  2.3 KB  |  100 lines

  1. // SimpleEdit MFCDoc.cpp : implementation of the CSimpleEditMFCDoc class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "SimpleEditMFC.h"
  6.  
  7. #include "SimpleEditMFCDoc.h"
  8. #include "SimpleEditMFCView.h"
  9.  
  10. #ifdef _DEBUG
  11. #define new DEBUG_NEW
  12. #undef THIS_FILE
  13. static char THIS_FILE[] = __FILE__;
  14. #endif
  15.  
  16. /////////////////////////////////////////////////////////////////////////////
  17. // CSimpleEditMFCDoc
  18.  
  19. IMPLEMENT_DYNCREATE(CSimpleEditMFCDoc, CDocument)
  20.  
  21. BEGIN_MESSAGE_MAP(CSimpleEditMFCDoc, CDocument)
  22.     //{{AFX_MSG_MAP(CSimpleEditMFCDoc)
  23.         // NOTE - the ClassWizard will add and remove mapping macros here.
  24.         //    DO NOT EDIT what you see in these blocks of generated code!
  25.     //}}AFX_MSG_MAP
  26. END_MESSAGE_MAP()
  27.  
  28. /////////////////////////////////////////////////////////////////////////////
  29. // CSimpleEditMFCDoc construction/destruction
  30.  
  31. CSimpleEditMFCDoc::CSimpleEditMFCDoc()
  32. {
  33.     // TODO: add one-time construction code here
  34.  
  35. }
  36.  
  37. CSimpleEditMFCDoc::~CSimpleEditMFCDoc()
  38. {
  39. }
  40.  
  41. BOOL CSimpleEditMFCDoc::OnNewDocument()
  42. {
  43.     if (!CDocument::OnNewDocument())
  44.         return FALSE;
  45.  
  46.     // TODO: add reinitialization code here
  47.     // (SDI documents will reuse this document)
  48.  
  49.     return TRUE;
  50. }
  51.  
  52. /////////////////////////////////////////////////////////////////////////////
  53. // CSimpleEditMFCDoc serialization
  54.  
  55. void CSimpleEditMFCDoc::Serialize(CArchive& ar)
  56. {
  57.     if (ar.IsStoring())
  58.     {
  59.         // TODO: add storing code here
  60.     }
  61.     else
  62.     {
  63.         // TODO: add loading code here
  64.     }
  65. }
  66.  
  67. /////////////////////////////////////////////////////////////////////////////
  68. // CSimpleEditMFCDoc diagnostics
  69.  
  70. #ifdef _DEBUG
  71. void CSimpleEditMFCDoc::AssertValid() const
  72. {
  73.     CDocument::AssertValid();
  74. }
  75.  
  76. void CSimpleEditMFCDoc::Dump(CDumpContext& dc) const
  77. {
  78.     CDocument::Dump(dc);
  79. }
  80. #endif //_DEBUG
  81.  
  82. /////////////////////////////////////////////////////////////////////////////
  83. // CSimpleEditMFCDoc commands
  84.  
  85. BOOL CSimpleEditMFCDoc::OnOpenDocument(LPCTSTR lpszPathName) 
  86. {
  87.     if (!CDocument::OnOpenDocument(lpszPathName))
  88.         return FALSE;
  89.     
  90.     // Set the Movie filename for the view
  91.     POSITION pos = GetFirstViewPosition();
  92.     CSimpleEditMFCView* pView = (CSimpleEditMFCView*)GetNextView(pos);
  93.     if (pView){
  94.         pView->mfullPath = lpszPathName;
  95.         if (pView->OpenMovie() != TRUE)
  96.             return FALSE;
  97.     }
  98.     return TRUE;
  99. }
  100.